import { createApp } from 'vue';
import App from './App.vue';
//<!--      路由依赖-->
import router from "./router/index.js";
//<!--      自定义less文件-->
import "@/assets/less/index.less";
//<!--     element-plus组件-->
import ElementPlus from 'element-plus';
//<!--     element-plus组件-->
import 'element-plus/dist/index.css';
//<!--     注册element-plus组件所有图标-->
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
//引入mock
import  "@/api/mock.js";
//api.js文件注册为全局
import api from "@/api/api.js";
//引入使用pinia
import { createPinia } from 'pinia';
import {useAllDataStore} from '@/stores/indes.js';
const pinia= createPinia();

const app =createApp(App);
//注册ElementPlus
app.use(ElementPlus);
//注册pinia
app.use(pinia);
//api.js文件注册为全局
app.config.globalProperties.$api=api;
const store =  useAllDataStore()
store.addMenu(router,"refresh")
//注册路由
app.use(router).mount('#app');
//  注册element-plus组件所有图标-->
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

